home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 September / CHIP NET Rehberi Eylül 1998.iso / tools / is30eval / IS30AENG / ISHARE.2 / NT40 / SERVER / SYSTEM / OEMNSVIS.INF < prev   
INI File  |  1998-05-19  |  41KB  |  1,262 lines

  1. ;+---------------------------------------------------------------------------
  2. ;+ OEMNSVIS.INF
  3. ;+
  4. ;+ Service installation INF file prototype for i.Share
  5. ;+ Copyright (c) 1997 Artisoft, Inc.
  6. ;+---------------------------------------------------------------------------
  7.  
  8. [Identification]
  9.     OptionType = NetService
  10.  
  11. [Options]
  12.     ISSERV
  13.  
  14. [FileConstants]
  15.     UtilityInf                = "UTILITY.INF"
  16.     subroutineinf             = "SUBROUTN.INF"
  17.     Exit_Code                 = 0
  18.     NetEventDLL               = "%SystemRoot%\System32\netevent.dll"
  19.     IoLogMsgDLL               = "%SystemRoot%\System32\IoLogMsg.dll"
  20.     NetMsgDLL                 = "%SystemRoot%\System32\NetMsg.dll"
  21.     Kernel32DLL               = "%SystemRoot%\System32\Kernel32.dll"
  22.     Manufacturer              = "Artisoft"
  23.     ProductProviderName       = "iShare"
  24.     ProductMajorVersion       = "3"
  25.     ProductMinorVersion       = "0"
  26.     ProductVersion            = $(ProductMajorVersion)"."$(ProductMinorVersion)
  27.     ProductOpSupportWSSERVER  = 132 
  28.     ProductISSERVName         = "iShareServer"
  29.     ProductMSFTSoftKey        = $(!NTN_SoftwareBase)"\Microsoft\Windows\CurrentVersion"
  30.     ProductSoftKey            = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductProviderName)
  31.  
  32. ;   -------------------------------------------------------------------------
  33. ;   REGISTRY VALUES
  34. ;
  35. ;   Format of list:
  36. ;      {RegKey,SubKey,ValueName,DataType,Data,DeleteKeyOnRemove}
  37. ;
  38. ;      RegKey            - Open registry key.
  39. ;      SubKey            - Subkey under the open key.
  40. ;      ValueName         - Name of value under subkey.
  41. ;      DataType          - One of the defined types.
  42. ;      Data              - Data under valuename
  43. ;      DeleteKeyOnRemove - Boolean (1 or 0) flag to remove key on deletion.
  44. ;   -------------------------------------------------------------------------
  45.  
  46.  
  47.  
  48. ;   -------------------------------------------------------------------------
  49. ;   SERVICE AND COMPONENT LIST
  50. ;   -------------------------------------------------------------------------
  51.  
  52.  
  53.     ProductWSSERVERName          = "WSSERVER"
  54.     ProductWSSERVERImagePath     = "\Program Files\Artisoft\Ishare\isrun32.exe"
  55.     ProductWSSERVERSvcType       = "service"
  56.     ProductWSSERVERKey           = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductWSSERVERName)"\CurrentVersion"
  57.     ProductWSSERVERParamKey      = $(!NTN_ServiceBase)"\"$(ProductWSSERVERName)"\Parameters"
  58.     ProductWSSERVERSvcKey        = $(!NTN_ServiceBase)"\"$(ProductWSSERVERName)
  59.     ProductWSSERVERNetRuleKey    = $(ProductWSSERVERKey)"\NetRules"
  60.     ProductWSSERVERGrpDepend     = "NetBiosGroup"
  61.     ProductWSSERVERType          = "service"
  62.     ProductWSSERVERBindReview     = 1
  63.     NetRuleWSSERVERBindable      = {"ishareServer netBiosTransport non non 100",+
  64.                                     "ishareServer ipxTransport non non 100"}
  65.     NetRuleWSSERVERType          = "wsserver ishareServer"
  66.     NetRuleWSSERVERClass         = {"iShareServer basic"}
  67.     NetRuleWSSERVERUse           = $(ProductWSSERVERType)" no no"
  68.     NetRuleWSSERVERBindForm      = """Wsserver"" yes yes container"
  69.  
  70. ;   -------------------------------------------------------------------------
  71. ;   SET THE COMPONENT AND SERVICE PIECES.
  72. ;
  73. ;   Form:
  74. ;      ComponentXXX
  75. ;      ServiceXXX
  76. ;
  77. ;   Comments:
  78. ;      A 'Service' is defined to be any driver run by the system.  A 
  79. ;      'Component' is a service that either (a) needs a binding or (b) needs
  80. ;      to have the name listed in the network property sheet.  In addition, 
  81. ;      the [InstallList] section needs to be filled with all Compoenent and
  82. ;      Service names.  
  83. ;   -------------------------------------------------------------------------
  84.  
  85. [InstallList]
  86.     ISSERV
  87.  
  88. ;   -------------------------------------------------------------------------
  89.  
  90. [ComponentISSERV]
  91.     WSSERVER
  92.  
  93. [ServiceISSERV]
  94.  
  95. ;   -------------------------------------------------------------------------
  96. ;   -------------------------------------------------------------------------
  97.  
  98. [GeneralConstants]
  99.     from               = ""
  100.     to                 = ""
  101.     ExitCodeOk         = 0
  102.     ExitCodeCancel     = 1
  103.     ExitCodeFatal      = 2
  104.     KeyNull            = ""
  105.     MAXIMUM_ALLOWED    = 33554432
  106.     SERVICE_NO_CHANGE  = 4294967295
  107.     RegistryErrorIndex = NO_ERROR
  108.     KeyProduct         = ""
  109.     KeyParameters      = ""
  110.     TRUE               = 1
  111.     FALSE              = 0
  112.     NoTitle            = 0
  113.     ExitState          = "Active"
  114.     OldVersionExisted  = $(FALSE)
  115.     DriverPath         = $(!STF_NTPATH)\drivers
  116.  
  117. [SystemVars]
  118.     !STF_PROCESSOR      = "" ? $(!LIBHANDLE) GetProcessor
  119.     !STF_PLATFORM       = "" ? $(!LIBHANDLE) GetPlatform
  120.     !STF_WINDOWSPATH    = "" ? $(!LIBHANDLE) GetWindowsNtDir
  121.     !STF_NTPATH         = $(!STF_WINDOWSPATH)
  122.     !STF_WINDOWSSYSPATH = "" ? $(!LIBHANDLE) GetWindowsNtSysDir
  123.     !STF_COMPUTERNAME   = "" ? $(!LIBHANDLE) GetMyComputerName
  124.     !STF_USERNAME       = "" ? $(!LIBHANDLE) GetMyUserName
  125.     !STF_FLOPPYLIST     = {} ? $(!LIBHANDLE) GetFloppyDriveLetters
  126.     !STF_UNUSEDDRIVES   = {} ? $(!LIBHANDLE) GetUnusedDrives
  127.     !STF_LANGUAGE       = "" ? $(!LIBHANDLE) GetLanguage
  128.     !STF_BUSTYPE        = "" ? $(!LIBHANDLE) GetMyBusType
  129.     !STF_BUSTYPELIST    = "" ? $(!LIBHANDLE) GetMyBusTypeList
  130.     !NTN_SoftwareBase   = "Software"
  131.     !NTN_ServiceBase    = "System\CurrentControlSet\Services"
  132.     !NTN_ScUseRegistry  = "NO"
  133.  
  134. [date]
  135.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  136.  
  137. [DetectSystemMemory]
  138.     SystemMemory    = "" ? $(!LIBHANDLE) GetMemorySize
  139.  
  140. [Identify]
  141.     read-syms Identification
  142.     set Status     = STATUS_SUCCESSFUL
  143.     set Identifier = $(OptionType)
  144.     set Media      = #("Source Media Descriptions", 1, 1)
  145.     Return $(Status) $(Identifier) $(Media)
  146.  
  147. [ReturnOptions]
  148.     set Status        = STATUS_FAILED
  149.     set OptionList     = {}
  150.     set OptionTextList = {}
  151.     set LanguageList = ^(LanguagesSupported, 1)
  152.     Ifcontains(i) $($0) in $(LanguageList)
  153.     goto returnoptions
  154.     else
  155.     set Status = STATUS_NOLANGUAGE
  156.     goto finish_ReturnOptions
  157.     endif
  158.  
  159. returnoptions = +
  160.     set OptionList     = ^(Options, 1)
  161.     set OptionTextList = ^(OptionsText$($0), 1)
  162.     set Status         = STATUS_SUCCESSFUL
  163.  
  164. finish_ReturnOptions = +
  165.     Return $(Status) $(OptionList) $(OptionTextList)
  166.  
  167. ; ---------------------------------------------------------------------------
  168. ; SHELL COMMANDS SECTION FOR AUTOMATED USE OF THIS INF FILE
  169. ; ---------------------------------------------------------------------------
  170.  
  171. [Shell Commands]
  172.     LoadLibrary "x" $(!STF_CWDDIR)setupdll.dll !LIBHANDLE
  173.     LoadLibrary "x" $(!STF_CWDDIR)ncpa.cpl !NCPA_HANDLE
  174.     ifstr(i) $(!LIBHANDLE) == ""
  175.        Debug-Output "OEMSETNT.INF: unable to load setupdll.dll"
  176.        set Exit_Code = STATUS_USERCANCEL
  177.        exit
  178.     endif
  179.     ifstr(i) $(!NCPA_HANDLE) == ""
  180.        Debug-Output "OEMSETNT.INF: unable to load ncpa.cpl"
  181.        set Exit_Code = STATUS_USERCANCEL
  182.        exit
  183.     endif
  184.     
  185.     read-syms SystemVars
  186.     detect    SystemVars
  187.  
  188. ;--DEBUG
  189. ;   Shell subroutn.inf, SetupMessage $(!STF_LANGUAGE) "STATUS" "NTN_InfSection: "$(!NTN_InfSection)
  190.  
  191.     Shell "" InstallOption $(!STF_LANGUAGE) $(!OEMNSVIS_OPTION) $(!STF_SRCDIR) "YES" "YES" "YES"
  192.     ifint $($ShellCode) != $( !SHELL_CODE_OK)
  193.        Debug-Output "OEMSETNT.INF: Failed to shell out to InstallOption"
  194.        Shell subroutn.inf, SetupMessage $(!STF_LANGUAGE) "STATUS" "Failed shell to InstallOption."
  195.        exit
  196.     endif
  197.     set Exit_Code = $($R0)
  198.     ifstr(i) $($R0) == STATUS_SUCCESSFUL
  199.        set Exit_Code = 1
  200.     endif
  201.     Debug-Output "OEMSETNT.INF: install returned "$($R0)
  202.  
  203.     FreeLibrary $(!LIBHANDLE)
  204.     FreeLibrary $(!NCPA_HANDLE)
  205.  
  206. ;--DEBUG    
  207. ;   Shell subroutn.inf, SetupMessage $(!STF_LANGUAGE) "STATUS" "Done."
  208.     
  209.     exit
  210.  
  211. ; ---------------------------------------------------------------------------
  212. ; ---------------------------------------------------------------------------
  213.  
  214. [InstallOption]
  215.     set Option   = $($1)
  216.     set SrcDir   = $($2)
  217.     set AddCopy  = $($3)
  218.     set DoCopy   = $($4)
  219.     set DoConfig = $($5)
  220.     set LanguageList = ^(LanguagesSupported, 1)
  221.     Ifcontains(i) $($0) NOT-IN $(LanguageList)
  222.     Return STATUS_NOLANGUAGE
  223.     endif
  224.  
  225.     Debug-Output "OEMSETNT.INF: STF_CWDDIR is: "$(!STF_CWDDIR)
  226.     Debug-Output "OEMSETNT.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  227.     set-subst LF = "\n"
  228.     read-syms GeneralConstants
  229.     read-syms FileConstants$(!STF_LANGUAGE)
  230.     read-syms FileConstants
  231.     read-syms DialogConstants$(!STF_LANGUAGE)
  232.     ifstr(i) $(!NTN_Origination) == "NCPA"
  233.     set Continue = $(OK)
  234.     endif
  235.     detect date
  236.     detect DetectSystemMemory
  237.     set-title  $(FunctionTitle)
  238.     set to   = Begin
  239.     set from = Begin
  240.     set CommonStatus = STATUS_SUCCESSFUL
  241.     
  242.     EndWait
  243.  
  244. Begin = +
  245.  
  246. ;   -------------------------------------------------------------------------
  247. ;   INSTALL CODE BEGINS
  248. ;   -------------------------------------------------------------------------
  249.  
  250. ;   Load the special-purpose DLL placed by InstallShield
  251.  
  252.     LoadLibrary "x" $(!STF_WINDOWSSYSPATH)\l4w32utl.dll !L4W32UTL_HANDLE
  253.     ifstr(i) $(!L4W32UTL_HANDLE) == ""
  254.         Debug-Output "OEMSETNT.INF: unable to load l4w32utl.dll"
  255.         set Exit_Code = STATUS_USERCANCEL
  256.         exit
  257.     endif
  258.  
  259.  
  260. ;   Set the global install lists that cover both components and services.
  261.  
  262.     ForListDo ^(InstallList,1)
  263.        Shell "" AppendList {+
  264.                 ^(Component$($),1),+
  265.                }
  266.        set !InstallList$($) = $($R0)
  267.     EndForListDo
  268.  
  269. ;   Set the install tasks based on the chosen option
  270.  
  271.     set DoISSERV  = FALSE
  272.  
  273. ;   Do the operations based on the !NTN_InstallMode when we came in.
  274.  
  275.     Ifstr(i) $(!NTN_InstallMode) == deinstall
  276.     ifstr(i) $(Option) == ISSERV
  277.        set DoISSERV  = TRUE
  278.     endif
  279.  
  280.     set OEM_ABANDON_OPTIONS = {}
  281.     ifstr(i) $(DoISSERV) == TRUE
  282.        ForListDo $(!InstallListISSERV) 
  283.           set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS),$(Product$($)Name))
  284.        EndForListDo
  285.     endif
  286.     set StartLabel = removewsserver
  287.     else-Ifstr(i) $(!NTN_InstallMode) == Update
  288.     set StartLabel = UpgradeSoftware
  289.     else-Ifstr(i) $(!NTN_InstallMode) == bind
  290.         set StartLabel = bindingadapter
  291.     else-Ifstr(i) $(!NTN_InstallMode) == configure
  292.     Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  293.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  294.         Debug-Output "OEMSETNT.INF: ShellCode error: cannot get an error string."
  295.         goto ShellCodeError
  296.     endif
  297.     set Error = $($R0)
  298.     set from = end
  299.     set to = end
  300.     goto nonfatalinfo
  301.     else
  302.     ifstr(i) $(Option) == ISSERV
  303.        set DoISSERV  = TRUE
  304.     endif
  305.  
  306.     set StartLabel = installadapter
  307.     set OEM_ABANDON_OPTIONS = {}
  308.     endif
  309.  
  310.     set from = $(fatal)
  311.     set to = $(fatal)
  312.  
  313.     goto $(StartLabel)
  314.  
  315. installadapter = +
  316.  
  317. ;   -------------------------------------------------------------------------
  318. ;   FIRST SET ALL DEPENDENCIES AND INSTALLABLE OPTIONS
  319. ;   -------------------------------------------------------------------------
  320.  
  321.     set InstallOptionList = {}
  322.  
  323.  
  324.     ifstr(i) $(DoISSERV) == TRUE
  325.        Shell "" AppendList, {+
  326.                  $(InstallOptionList),+
  327.                  $(!InstallListISSERV)+
  328.                 }
  329.        set InstallOptionList = $($R0)
  330.     endif
  331.  
  332. ;   -------------------------------------------------------------------------
  333. ;   Make sure component is not already installed.  If it is, don't re-install
  334. ;   -------------------------------------------------------------------------
  335.  
  336.     ForListDo $(InstallOptionList)
  337.     OpenRegKey $(!REG_H_LOCAL) "" $(Product$($)SvcKey) $(MAXIMUM_ALLOWED) KeyProduct
  338.     Ifstr $(KeyProduct) != $(KeyNull)
  339.         ifcontains(i) $($) in $(!InstallListISSERV)
  340.         set DoISSERV  = FALSE
  341.         endif
  342.     endif
  343.     CloseRegKey $(KeyProduct)
  344.     EndForListDo
  345.     goto nextstep
  346.  
  347. nextstep = +
  348.     StartWait
  349.     Ifstr(i) $(!NTN_InstallMode) == install
  350.     Ifint $(OldVersionExisted) == $(FALSE)
  351.         goto installproduct
  352.     endif
  353.     endif
  354.     goto writeparameters
  355.  
  356. installproduct = +
  357.     Ifstr(i) $(DoCopy) == "YES"
  358.        
  359. ;      ----------------------------------------------------------------------
  360. ;      SET THE SOURCE DIRECTORIES FOR EACH COMPONENT AND SERVICE
  361. ;      ----------------------------------------------------------------------
  362.  
  363.        ifstr(i) $(DoISSERV) == TRUE
  364.       Shell "" SetDefaultSrcDir $(!REG_H_LOCAL) $(ProductSoftKey) "InstallDirectory"
  365.       Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  366.       Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  367.           Goto ShellCodeError
  368.       Else-Ifstr(i) $($R0) == STATUS_FAILED
  369.           Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  370.           ifint $($ShellCode) != $(!SHELL_CODE_OK)
  371.           goto ShellCodeError
  372.           endif
  373.           set Error = $($R0)
  374.           Goto fatal
  375.       Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  376.           Goto successful
  377.       Endif
  378.       set SrcDirWSSERVER = $($R1)
  379.        endif
  380.        
  381.     Endif
  382.  
  383.     install "Install-Option"
  384.     ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  385.        Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  386.        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  387.        goto ShellCodeError
  388.        endif
  389.        set Error = $($R0)
  390.        goto fatal
  391.     endif
  392.  
  393.     set OEM_ABANDON_ON  = TRUE
  394.  
  395.  
  396. ;   -------------------------------------------------------------------------
  397. ;   FIRST INSTALL THE SOFTWARE COMPONENT(S)
  398. ;   -------------------------------------------------------------------------
  399.  
  400.  
  401.     Debug-Output "OEMSETNT.INF: Install Workstation in registry."
  402.  
  403.     set TempOptionList = {}
  404.  
  405.     ifstr(i) $(DoISSERV) == TRUE
  406.        Shell "" AppendList {$(TempOptionList) ^(ComponentISSERV,1)}
  407.        set TempOptionList = $($R0)
  408.     endif
  409.  
  410.     ForListDo $(TempOptionList)
  411.  
  412.     set ProductName        = $(Product$($)Name)
  413.     set ProductDisplayName = $(Product$($)DisplayName)
  414.     set ProductImagePath   = $(Product$($)ImagePath)
  415.     set ProductGroup       = $(Product$($)Group)
  416.     set ProductDepend      = $(Product$($)Depend)
  417.     set ProductTitle       = $(Product$($)Title)
  418.     set ProductDescription = $(Product$($)Description)
  419.     set ProductSvcType     = $(Product$($)SvcType)
  420.     set ProductGrpDepend   = $(Product$($)GrpDepend)
  421.     set ProductInteract    = $(Product$($)Interact)
  422.     set ProductType        = $(Product$($)Type)
  423.     set ProductBindReview  = $(Product$($)BindReview)
  424.     set ProductHidden      = $(Product$($)Hidden)
  425.     set NetRuleBindable    = $(NetRule$($)Bindable)
  426.     set NetRuleType        = $(NetRule$($)Type)
  427.     set NetRuleClass       = $(NetRule$($)Class)
  428.     set NetRuleUse         = $(NetRule$($)Use)
  429.     set NetRuleBindForm    = $(NetRule$($)BindForm)
  430.  
  431.     ifcontains(i) $($) in ^(ComponentISSERV,1)
  432.         set ProductOption = WSSERVER
  433.     endif
  434.  
  435.     Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(ProductName))
  436.     Debug-Output "OEMSETNT.INF: Install "$(ProductName)" in registry."
  437.  
  438.  
  439. ;--DEBUG
  440. ;       Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "STATUS", "About to do "$($)
  441.  
  442.     Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  443.         $(ProductName), +
  444.         $(ProductName), +
  445.         $(ProductDisplayName), $(STF_CONTEXTINFNAME), +
  446.         $(ProductImagePath), $(ProductSvcType), $(ProductGroup), +
  447.         $(ProductDepend), "",+
  448.         $(NetEventDLL)
  449.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  450.         Debug-Output "OEMSETNT.INF: ShellCode error"
  451.         goto ShellCodeError
  452.     endif
  453.  
  454.     set RegistryErrorIndex = $($R0)
  455.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  456.         EndWait
  457.         Debug-Output "OEMSETNT.INF: Registry error: add software components"
  458.         CloseRegKey $($R1)
  459.         CloseRegKey $($R2)
  460.         CloseRegKey $($R3)
  461.         CloseRegKey $($R4)
  462.         CloseRegKey $($R5)
  463.         goto fatalregistry
  464.     endif
  465.    
  466.     Set SoftProductKey      = $($R1)
  467.     Set SoftNetRuleKey      = $($R2)
  468.     Set SoftServiceKey      = $($R3)
  469.     Set SoftParameterKey    = $($R4)
  470.     Set SoftLinkageKey      = $($R5)
  471.  
  472. ;       ------------------------------------------------------------------
  473. ;       SET THE SERVICE INTERACTIVE FLAG IF NECESSARY
  474. ;       ------------------------------------------------------------------
  475.  
  476.  
  477.     set NewValueList = {+
  478.                 {SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(ProductType)},+
  479.                 {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  480.                 {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  481.                 {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductTitle)},+
  482.                 {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductDescription)},+
  483.                 {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductName)},+
  484.                 {hidden,$(NoTitle),$(!REG_VT_DWORD),$(ProductHidden)},+
  485.                 {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)},+
  486.                 {Review,$(NoTitle),$(!REG_VT_DWORD),$(ProductBindReview)}+
  487.                }
  488.  
  489. ;--DEBUG
  490. ;       Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "STATUS", "Made it past AddSoftwareComponent."
  491.  
  492.     Shell  $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  493.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  494.         Debug-Output "OEMSETNT.INF: ShellCode error."
  495.         goto ShellCodeError
  496.     endif
  497.     set RegistryErrorIndex = $($R0)
  498.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  499.         EndWait
  500.         Debug-Output "OEMSETNT.INF: registry error: add value list."
  501.         CloseRegKey $(SoftProductKey)
  502.         CloseRegKey $(SoftNetRuleKey)
  503.         CloseRegKey $(SoftServiceKey)
  504.         CloseRegKey $(SoftLinkageKey)
  505.         CloseRegKey $(SoftParameterKey)
  506.         goto fatalregistry
  507.     endif
  508.  
  509.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleType)},+
  510.                 {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleBindable)},+
  511.                 {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleClass)}, +
  512.                 {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleUse)}, +
  513.                 {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleBindForm)}, +
  514.                 {InfOption,$(NoTitle),$(!REG_VT_SZ),$(ProductOption)}}
  515.  
  516. ;--DEBUG
  517. ;       Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "STATUS", "Made it past first ValueList."
  518.  
  519.     Shell  $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  520.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  521.         Debug-Output "OEMSETNT.INF: ShellCode error."
  522.         goto ShellCodeError
  523.     endif
  524.  
  525.     set NewValueList = {{"DependOnGroup",$(NoTitle),$(!REG_VT_MULTI_SZ),$(ProductGrpDepend)}}
  526.     Shell $(UtilityInf), AddValueList, $(SoftServiceKey), $(NewValueList)
  527.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  528.         Debug-Output "OEMSETNT.INF: ShellCode error."
  529.         goto ShellCodeError
  530.     endif
  531.  
  532.     set NewValueList = {{OtherDependencies,$(NoTitle),$(!REG_VT_MULTI_SZ),$(ProductDepend)}}
  533.     Shell $(UtilityInf), AddValueList, $(SoftLinkageKey), $(NewValueList)
  534.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  535.         Debug-Output "OEMSETNT.INF: ShellCode error."
  536.         goto ShellCodeError
  537.     endif
  538.  
  539.     set RegistryErrorIndex = $($R0)
  540.     CloseRegKey $(SoftProductKey)
  541.     CloseRegKey $(SoftNetRuleKey)
  542.     CloseRegKey $(SoftServiceKey)
  543.     CloseRegKey $(SoftParameterKey)
  544.     CloseRegKey $(SoftLinkageKey)
  545.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  546.         EndWait
  547.         Debug-Output "OEMSETNT.INF: Registry error: add value list."
  548.         goto fatalregistry
  549.     endif
  550.  
  551. ;--DEBUG
  552. ;       Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "STATUS", "Made it second ValueList."
  553.  
  554.     EndForListDo
  555.  
  556. ;   -------------------------------------------------------------------------
  557. ;   -------------------------------------------------------------------------
  558.  
  559.     Goto writeparameters
  560.  
  561. writeparameters = +
  562.     goto successful
  563.  
  564. bindingadapter =+
  565.     ForListDo ^(InstallList,1)
  566.  
  567.         ForListDo $(!InstallList$($))
  568.  
  569.             set LinkageKey = $(Product$($)SvcKey)"\LINKAGE"
  570.             set ServiceName = $(Product$($)Name)
  571.  
  572. ;           -----------------------------------------------------------------
  573. ;           Only fix the service if the review value is set.
  574. ;           -----------------------------------------------------------------
  575.  
  576.             set ReviewKey = "SOFTWARE\Artisoft\"$(ServiceName)"\CurrentVersion"
  577.             OpenRegKey $(!REG_H_LOCAL) "" $(ReviewKey) $(MAXIMUM_ALLOWED) CS_ReviewKey
  578.             ifstr $(CS_ReviewKey) != ""
  579.                 GetRegValue $(CS_ReviewKey) "Review" ReviewInfo
  580.  
  581.                 ifint *($(ReviewInfo),4) != 0
  582.  
  583. ;                   ---------------------------------------------------------
  584. ;                   Open the linkage key
  585. ;                   ---------------------------------------------------------
  586.  
  587.                     OpenRegKey $(!REG_H_LOCAL) "" $(LinkageKey) $(MAXIMUM_ALLOWED) CS_TempKey
  588.                     ifstr $(CS_TempKey) != ""
  589.                         GetRegValue $(CS_TempKey) "Bind" BindInfo
  590.  
  591.  
  592. ;                       -----------------------------------------------------
  593. ;                       Disable Dial-up adapters.
  594. ;                       -----------------------------------------------------
  595.  
  596. ;                        ForListDo *($(BindInfo),4)
  597. ;                            LibraryProcedure Result, $(!L4W32UTL_HANDLE) StrStr $($) "Dial-Up"
  598. ;                            ifint $(Result) != 0
  599. ;                                GetRegValue $(CS_TempKey) "Bind" CurrentBindInfo
  600. ;                                set CurrentBindList = *($(CurrentBindInfo),4)
  601. ;                                Shell "", GetListIndex $(CurrentBindList) $($)
  602. ;                                ifint $($R0) != 0
  603. ;                                    Shell $(UtilityInf), ToggleBinding $(ServiceName) $($R0) "Disable"
  604. ;                                endif
  605. ;                            endif
  606. ;                        EndForListDo
  607.  
  608.  
  609. ;                       ---------------------------------------------------------
  610. ;                       Check bindings again if from setup and not from NCPA.
  611. ;                       ---------------------------------------------------------
  612.  
  613.                         set ISSetupKey = "SOFTWARE\Artisoft\IShare"
  614.                         OpenRegKey $(!REG_H_LOCAL) "" $(ISSetupKey) $(MAXIMUM_ALLOWED) CS_ISSetupKey
  615.                         ifstr $(CS_ISSetupKey) != ""
  616.                             GetRegValue $(CS_ISSetupKey) "Setup" SetupInfo
  617.  
  618.                             ifint *($(SetupInfo),4) != 0
  619.  
  620.     
  621.                                 GetRegValue $(CS_ISSetupKey) "Bind" ISBind
  622.                                 GetRegValue $(CS_TempKey) "Bind" BindInfo
  623.  
  624.  
  625. ;                              -----------------------------------------------------
  626. ;                              For each item bound, disable anything we don't like.
  627. ;                              -----------------------------------------------------
  628.     
  629.                                  ForListDo *($(BindInfo),4)
  630.                                     LibraryProcedure Result, $(!L4W32UTL_HANDLE) StrStr $($) *($(ISBind),4)
  631.                                     ifint $(Result) == 0
  632.                                         GetRegValue $(CS_TempKey) "Bind" CurrentBindInfo
  633.                                         set CurrentBindList = *($(CurrentBindInfo),4)
  634.                                         Shell "", GetListIndex $(CurrentBindList) $($)
  635.                                         ifint $($R0) != 0
  636.                                             Shell $(UtilityInf), ToggleBinding $(ServiceName) $($R0) "Disable"
  637.                                         endif
  638.                                     endif
  639.                                 EndForListDo
  640.                             endif
  641.                         endif
  642.                     
  643.                     endif
  644.  
  645. ;                   ---------------------------------------------------------
  646. ;                   Close the linkage key
  647. ;                   ---------------------------------------------------------
  648.  
  649.                     ifstr(i) $(CS_TempKey) != ""
  650.                         CloseRegKey $(CS_TempKey)
  651.                     endif
  652.  
  653.  
  654.                 endif
  655.  
  656.                 CloseRegKey $(CS_ReviewKey)
  657.                 CloseRegKey $(CS_SetupKey)
  658.  
  659.             endif
  660.     
  661.         EndForListDo
  662.  
  663.     EndForListDo        
  664.  
  665.     goto end
  666.  
  667. removewsserver = +
  668.  
  669.    
  670.     
  671.     Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), "WSSERVER"
  672.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  673.        Debug-Output "OEMSETNT.INF: ShellCode error"
  674.        goto ShellCodeError
  675.     endif
  676.     set RegistryErrorIndex = $($R0)
  677.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  678.        goto fatalregistry
  679.     endif
  680.         
  681. ;    Shell $(UtilityInf), RemoveService, $($), "YES"
  682.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  683.         Debug-Output "OEMSETNT.INF: ShellCode error"
  684.         goto ShellCodeError
  685.     endif
  686.     
  687.     set RegistryErrorIndex = $($R0)
  688.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  689.        goto fatalregistry
  690.     endif
  691.  
  692.  
  693.     ifstr(i) $(DoISSERV) == TRUE
  694.  
  695. ;      ----------------------------------------------------------------------
  696. ;      DELETE REGISTRY KEYS
  697. ;      ----------------------------------------------------------------------
  698.  
  699.  
  700. ;       DeleteRegTree $(ProductWSSERVERSvcKey)
  701.  
  702. ;      ----------------------------------------------------------------------    
  703. ;      DELETE FILES
  704. ;      ----------------------------------------------------------------------
  705.  
  706.        set RemoveFilesList = ^(RemFiles-WSSERVER, 1)
  707.  
  708.        ForListDo $(RemoveFilesList)
  709.        Set FullRemovePath = $(!STF_WINDOWSSYSPATH)$($)
  710.        LibraryProcedure Result, $(!LIBHANDLE), DelFile $(FullRemovePath)
  711.        EndForListDo
  712.  
  713.     endif
  714.  
  715.     goto end
  716.  
  717. UpgradeSoftware = +
  718.     set Error = "Upgrade: Sorry, not yet implemented."
  719.     goto fatal
  720.  
  721. successful = +
  722.     goto end
  723.  
  724. warning = +
  725.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  726.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  727.     goto ShellCodeError
  728.     endif
  729.     ifstr(i) $($R1) == "OK"
  730.     goto $(to)
  731.     else-ifstr(i) $($R1) == "CANCEL"
  732.     goto $(from)
  733.     else
  734.     goto end
  735.     endif
  736.  
  737. nonfatalinfo = +
  738.     Set CommonStatus = STATUS_USERCANCEL
  739.     Set Severity = STATUS
  740.     goto nonfatalmsg
  741.  
  742. nonfatal = +
  743.     Set Severity = NONFATAL
  744.     goto nonfatalmsg
  745.  
  746. nonfatalmsg = +
  747.     ifstr(i) $(Error) == ""
  748.     Set Severity = NONFATAL
  749.     Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  750.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  751.         goto ShellCodeError
  752.     endif
  753.     set Error = $($R0)
  754.     endif
  755.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  756.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  757.     goto ShellCodeError
  758.     endif
  759.     ifstr(i) $($R1) == "OK"
  760.     goto $(from)
  761.     else
  762.     goto "end"
  763.     endif
  764.  
  765. fatalregistry = +
  766.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  767.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  768.     goto ShellCodeError
  769.     endif
  770.     set Error = $($R0)
  771.     goto fatal
  772.  
  773. fatal = +
  774.     ifstr(i) $(Error) == ""
  775.     Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  776.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  777.         goto ShellCodeError
  778.     endif
  779.     set Error = $($R0)
  780.     endif
  781.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  782.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  783.     goto ShellCodeError
  784.     endif
  785.     goto setfailed
  786.  
  787. ShellCodeError = +
  788.     set DlgType      = "MessageBox"
  789.     set STF_MB_TITLE = $(ShellCodeErrorTitle)
  790.     set STF_MB_TEXT  = $(ShellCodeErrorText)
  791.     set STF_MB_TYPE  = 1
  792.     set STF_MB_ICON  = 3
  793.     set STF_MB_DEF   = 1
  794.     ui start "Error Message"
  795.     goto setfailed
  796.  
  797. setfailed = +
  798.     set CommonStatus = STATUS_FAILED
  799.     Ifint $(RegistryErrorIndex) == CANT_REMOVE_WKSTA_NTAS
  800.     set CommonStatus = STATUS_USERCANCEL
  801.     endif
  802.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  803.     set OEM_ABANDON_ON = FALSE
  804.     goto removewsserver
  805.     endif
  806.     goto end
  807.  
  808. end = +
  809.     FreeLibrary $(!L4W32UTL_HANDLE)
  810.     goto term
  811.  
  812. term = +
  813.     Return $(CommonStatus)
  814.  
  815. [Install-Option]
  816.     set STF_VITAL = ""
  817.     ifstr(i) $(AddCopy) == "YES"
  818.     ifstr(i) $(DoISSERV) == TRUE
  819.        AddSectionFilesToCopyList Files-WSSERVER $(SrcDirWSSERVER) $(!STF_WINDOWSSYSPATH)
  820.     endif
  821.     endif
  822.     ifstr(i) $(DoCopy) == "YES"
  823.        set !STF_NCPA_FLUSH_COPYLIST = TRUE
  824.        CopyFilesInCopyList
  825.     endif
  826.     ifstr(i) $(DoConfig) == "YES"
  827.     endif
  828.     Exit
  829.  
  830. [Install-Update]
  831.    set STF_VITAL        = ""
  832.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  833.    ifstr(i) $(DoISSERV) == TRUE
  834.       AddSectionFilesToCopyList Files-WSSERVER $(SrcDirWSSERVER) $(!STF_WINDOWSSYSPATH)
  835.    endif
  836.    Exit
  837.  
  838. [Source Media Descriptions]
  839.     1 = "i.Share Install Disk-1",TAGFILE = disk1
  840.  
  841. [Signature]
  842.     FileType = MICROSOFT_FILE
  843.  
  844. [GetSignature]
  845.     read-syms Signature
  846.     return $(FileType)
  847.  
  848. [ProductType]
  849.     STF_PRODUCT  = Winnt
  850.     STF_PLATFORM = I386
  851.  
  852. ;   -------------------------------------------------------------------------
  853. ;   -------------------------------------------------------------------------
  854.  
  855. [Files-WSSERVER]
  856. ;    1,WSSERVER.EXE,SIZE=500000
  857.  
  858. [RemFiles-WSSERVER]
  859. ;        WSSERVER.EXE
  860.  
  861.  
  862. ; END OF MAIN SECTION
  863.  
  864.  
  865.  
  866. ; ---------------------------------------------------------------------------
  867. ; SetDefaultSrcDir
  868. ;
  869. ; Description:
  870. ;   Finds a source directory in the given registry key.
  871. ;
  872. ; Usage:
  873. ;   Shell "" SetDefaultSrcDir $(OpenKeyHandle) $(KeyName) $(ValueName) $(ExtraPath)
  874. ; ---------------------------------------------------------------------------
  875.  
  876. [SetDefaultSrcDir]
  877.     set KeyHandle = $($0)
  878.     set KeyName   = $($1)
  879.     set ValueName = $($2)
  880.     set ExtraPath = $($3)
  881.  
  882.     read-syms GeneralConstants
  883.     read-syms FileConstants$(!STF_LANGUAGE)
  884.     read-syms FileConstants
  885.     read-syms DialogConstants$(!STF_LANGUAGE)
  886.  
  887.     set !STF_SRCDIR_OVERRIDE = ""
  888.     OpenRegKey $(KeyHandle) "" $(KeyName) $(MAXIMUM_ALLOWED) CS_KeyHandle
  889.     ifstr $(CS_KeyHandle) != ""
  890.        GetRegValue $(CS_KeyHandle) $(ValueName) ValueList
  891.        set ValueType = *($(ValueList),3)
  892.        ifstr(i) $(ValueType) == $(!REG_VT_SZ)
  893.       set !STF_SRCDIR_OVERRIDE = *($(ValueList),4)
  894.        endif  
  895.     endif
  896.     CloseRegKey $(CS_KeyHandle)
  897.     ifstr(i) $(!STF_SRCDIR_OVERRIDE) != ""
  898.        ifstr(i) $(ExtraPath) != ""
  899.       set !STF_SRCDIR_OVERRIDE = $(!STF_SRCDIR_OVERRIDE)"\"$(ExtraPath)
  900.        endif
  901.     endif
  902.    
  903. SetDefaultSrcDir_RETURN =+
  904.     return
  905.  
  906. ; ---------------------------------------------------------------------------
  907. ; SHELL SUBROUTINES
  908. ; ---------------------------------------------------------------------------
  909.  
  910. ; ---------------------------------------------------------------------------
  911. ; AppendList
  912. ;
  913. ; Description:
  914. ;   Appends List2 to List1
  915. ;
  916. ; Usage:
  917. ;   Shell "" AppendList {$(List1), $(List2), ... , $(ListN)}
  918. ; ---------------------------------------------------------------------------
  919.  
  920. [AppendList]
  921.     set ListOfLists = $($0)
  922.  
  923.     set NewList = {}
  924.     ForListDo $(ListOfLists)
  925.        set CurrentList = $($)
  926.        ForListDo $(CurrentList)
  927.       set NewList = >($(NewList),$($))
  928.        EndForListDo
  929.     EndForListDo
  930.  
  931. AppendList_RETURN =+
  932.     return $(NewList)
  933.  
  934. ; ---------------------------------------------------------------------------
  935. ; WriteKeyValueSection
  936. ;
  937. ; Usage:
  938. ;   Shell "" WriteKeyValueSection $(ProductRegKeys)
  939. ; ---------------------------------------------------------------------------
  940.  
  941. [WriteKeyValueSection]
  942.     set RegKeyList = $($0)
  943.  
  944.     read-syms GeneralConstants
  945.     read-syms FileConstants$(!STF_LANGUAGE)
  946.     read-syms FileConstants
  947.     read-syms DialogConstants$(!STF_LANGUAGE)
  948.  
  949.     ForListDo $(RegKeyList)
  950.        set KeyHandle = *($($),1)
  951.        set KeyName   = *($($),2)
  952.        set ValueName = *($($),3)
  953.        set ValueType = *($($),4)
  954.        set ValueData = *($($),5)
  955.  
  956.        Shell "", WriteKeyValue $(KeyHandle) $(KeyName) $(ValueName) $(ValueType) $(ValueData)
  957.        set RegistryErrorIndex = $($R0)
  958.        Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  959.       goto WriteKeyValueSection_RETURN
  960.        endif
  961.     EndForListDo
  962.  
  963. WriteKeyValueSection_RETURN =+
  964.     return $(RegistryErrorIndex)
  965.     
  966. ; ---------------------------------------------------------------------------
  967. ; WriteKeyValue
  968. ;
  969. ; Usage:
  970. ;   Shell "" WriteKeyValue $(KeyHandle) +
  971. ;                          $(KeyName)   +
  972. ;                          $(ValueName) +
  973. ;                          $(ValueType) +
  974. ;                          $(ValueData)
  975. ; ---------------------------------------------------------------------------
  976.  
  977. [WriteKeyValue]
  978.     set KeyHandle = $($0)
  979.     set KeyName   = $($1)
  980.     set ValueName = $($2)
  981.     set ValueType = $($3)
  982.     set ValueData = $($4)
  983.     set RegistryErrorIndex = NO_ERROR
  984.  
  985.     read-syms GeneralConstants
  986.     read-syms FileConstants$(!STF_LANGUAGE)
  987.     read-syms FileConstants
  988.     read-syms DialogConstants$(!STF_LANGUAGE)
  989.  
  990.     Shell "" CreateOrOpenKey $(KeyHandle) $(KeyName)
  991.     set RegistryErrorIndex = $($R0)
  992.     set CS_KeyHandle       = $($R1)
  993.     Ifstr $(RegistryErrorIndex) != NO_ERROR
  994.        goto WriteKeyValue_RETURN
  995.     endif
  996.  
  997.     SetRegValue $(CS_KeyHandle) {$(ValueName),$(NoTitle),$(ValueType),$(ValueData)}
  998.     CloseRegKey $(CS_KeyHandle)
  999.  
  1000. WriteKeyValue_RETURN =+
  1001.     return $(RegistryErrorIndex)
  1002.  
  1003. ; ---------------------------------------------------------------------------
  1004. ; DeleteKeyValueSection
  1005. ;
  1006. ; Usage:
  1007. ;   Shell "" DeleteKeyValueSection $(ProductRegKeys)
  1008. ; ---------------------------------------------------------------------------
  1009.  
  1010. [DeleteKeyValueSection]
  1011.     set RegKeyList = $($0)
  1012.     set RegistryErrorIndex = NO_ERROR
  1013.  
  1014.     read-syms GeneralConstants
  1015.     read-syms FileConstants$(!STF_LANGUAGE)
  1016.     read-syms FileConstants
  1017.     read-syms DialogConstants$(!STF_LANGUAGE)
  1018.  
  1019.     ForListDo $(RegKeyList)
  1020.        set KeyHandle     = *($($),1)
  1021.        set KeyName       = *($($),2)
  1022.        set ValueName     = *($($),3)
  1023.        set DeleteKeyFlag = *($($),6)
  1024.  
  1025.        ifint $(DeleteKeyFlag) == 0
  1026.        Shell "", DeleteKeyValue $(KeyHandle) $(KeyName) $(ValueName)
  1027.        set RegistryError = $($R0)
  1028.        Ifstr(i) $(RegistryError) != NO_ERROR
  1029.            ifstr(i) $(RegistryErrorIndex) == NO_ERROR
  1030.            set RegistryErrorIndex = $(RegistryError)
  1031.            endif
  1032.        endif
  1033.        else
  1034.        DeleteRegTree $(KeyHandle) $(KeyName)
  1035.        Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1036.            ifstr(i) $(RegistryErrorIndex) == NO_ERROR
  1037.            set RegistryErrorIndex = $(ShellCodeErrorText)
  1038.            endif
  1039.        endif
  1040.        endif
  1041.     EndForListDo
  1042.  
  1043. DeleteKeyValueSection_RETURN =+
  1044.     return $(RegistryErrorIndex)
  1045.     
  1046. ; ---------------------------------------------------------------------------
  1047. ; DeleteKeyValue
  1048. ;
  1049. ; Usage:
  1050. ;   Shell "" WriteKeyValue $(KeyHandle) +
  1051. ;                          $(KeyName)   +
  1052. ;                          $(ValueName)
  1053. ; ---------------------------------------------------------------------------
  1054.  
  1055. [DeleteKeyValue]
  1056.     set KeyHandle          = $($0)
  1057.     set KeyName            = $($1)
  1058.     set ValueName          = $($2)
  1059.     set RegistryErrorIndex = NO_ERROR
  1060.     set CS_KeyHandle       = ""
  1061.  
  1062.     read-syms GeneralConstants
  1063.     read-syms FileConstants$(!STF_LANGUAGE)
  1064.     read-syms FileConstants
  1065.     read-syms DialogConstants$(!STF_LANGUAGE)
  1066.  
  1067.     OpenRegKey $(KeyHandle) "" $(KeyName) $(MAXIMUM_ALLOWED) CS_KeyHandle
  1068.     Ifstr $(CS_KeyHandle) == ""
  1069.     set RegistryErrorIndex = $(ShellCodeErrorText)
  1070.     goto DeleteKeyValue_RETURN
  1071.     endif
  1072.  
  1073.     DeleteRegValue $(CS_KeyHandle) $(ValueName)
  1074.     Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1075.     set RegistryErrorIndex = $(ShellCodeErrorText)
  1076.     goto DeleteKeyValue_RETURN
  1077.     endif
  1078.  
  1079. DeleteKeyValue_RETURN =+
  1080.     CloseRegKey $(CS_KeyHandle)
  1081.     return $(RegistryErrorIndex)
  1082.  
  1083. ; ---------------------------------------------------------------------------
  1084. ; CreateOrOpenKey
  1085. ;
  1086. ; Description:
  1087. ;   Creates a new key or opens an existing one. 
  1088. ;
  1089. ; Usage:
  1090. ;   Shell "" CreateOrOpenKey $(OpenKeyHandle) $(NewKeyName)
  1091. ; ---------------------------------------------------------------------------
  1092.  
  1093. [CreateOrOpenKey]
  1094.     set KeyHandle = $($0)
  1095.     set KeyName   = $($1)
  1096.     set RegistryErrorIndex = NO_ERROR
  1097.  
  1098.     read-syms GeneralConstants
  1099.     read-syms FileConstants$(!STF_LANGUAGE)
  1100.     read-syms FileConstants
  1101.     read-syms DialogConstants$(!STF_LANGUAGE)
  1102.  
  1103.     CreateRegKey $(KeyHandle) {$(KeyName),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" CS_KeyHandle
  1104.     ifstr $(CS_KeyHandle) == ""
  1105.     OpenRegKey $(KeyHandle) "" $(KeyName) $(MAXIMUM_ALLOWED) CS_KeyHandle
  1106.     endif
  1107.     Ifstr $(CS_KeyHandle) == ""
  1108.        set RegistryErrorIndex = $(ShellCodeErrorText)
  1109.        CloseRegKey $(CS_KeyHandle)
  1110.     endif
  1111.  
  1112. CreateOrOpenKey_RETURN =+
  1113.     return $(RegistryErrorIndex) $(CS_KeyHandle)
  1114.  
  1115. ; ---------------------------------------------------------------------------
  1116. ; SwapKeyValues
  1117. ;
  1118. ; Description:
  1119. ;   Takes two registry keys as arguments and effectively swaps the values for
  1120. ;   the given key.  Note that the key types MUST be the same, or an error
  1121. ;   will result.
  1122. ;
  1123. ; Usage:
  1124. ;   Shell "" SwapKeyValues {OpenKeyOne,Key1,Value1} {OpenKey2,Key2,Value2}
  1125. ; ---------------------------------------------------------------------------
  1126.  
  1127. [SwapKeyValues]
  1128.     set KeyList1 = $($0)
  1129.     set KeyList2 = $($1)
  1130.     set RegistryErrorIndex = NO_ERROR
  1131.  
  1132.     read-syms GeneralConstants
  1133.     read-syms FileConstants$(!STF_LANGUAGE)
  1134.     read-syms FileConstants
  1135.     read-syms DialogConstants$(!STF_LANGUAGE)
  1136.  
  1137.     Shell "" CreateOrOpenKey *($(KeyList1),1) *($(KeyList1),2)
  1138.     set RegistryErrorIndex = $($R0)
  1139.     set CS_KeyHandle1      = $($R1)
  1140.     Ifstr $(RegistryErrorIndex) != NO_ERROR
  1141.     goto SwapKeyValues_RETURN
  1142.     endif
  1143.  
  1144.     Shell "" CreateOrOpenKey *($(KeyList2),1) *($(KeyList2),2)
  1145.     set RegistryErrorIndex = $($R0)
  1146.     set CS_KeyHandle2      = $($R1)
  1147.     Ifstr $(RegistryErrorIndex) != NO_ERROR
  1148.     goto SwapKeyValues_RETURN
  1149.     endif
  1150.  
  1151.     GetRegValue $(CS_KeyHandle1) *($(KeyList1),3) ListData1
  1152.     set GetValueStatus1 = $(RegLastError)
  1153.  
  1154.     GetRegValue $(CS_KeyHandle2) *($(KeyList2),3) ListData2
  1155.     set GetValueStatus2 = $(RegLastError)
  1156.  
  1157.     ifint $(GetValueStatus1) != $(!REG_ERROR_SUCCESS)
  1158.     ifint $(GetValueStatus2) != $(!REG_ERROR_SUCCESS)
  1159.         set RegistryErrorIndex = $(ShellCodeErrorText)  
  1160.         goto SwapKeyValues_RETURN
  1161.     endif
  1162.     endif
  1163.  
  1164.     ifint $(GetValueStatus2) != $(!REG_ERROR_SUCCESS)
  1165.     DeleteRegValue $(CS_KeyHandle1) *($(KeyList1),3)
  1166.     else
  1167.     SetRegValue $(CS_KeyHandle1) $(ListData2)
  1168.     Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1169.         set RegistryErrorIndex = $(ShellCodeErrorText)
  1170.         goto SwapKeyValues_RETURN
  1171.     endif
  1172.     endif
  1173.     
  1174.     ifint $(GetValueStatus1) != $(!REG_ERROR_SUCCESS)
  1175.     DeleteRegValue $(CS_KeyHandle2) *($(KeyList2),3)
  1176.     else
  1177.     SetRegValue $(CS_KeyHandle2) $(ListData1)
  1178.     Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1179.         set RegistryErrorIndex = $(ShellCodeErrorText)
  1180.         goto SwapKeyValues_RETURN
  1181.     endif
  1182.     endif
  1183.  
  1184. SwapKeyValues_RETURN =+
  1185.     CloseRegKey $(CS_KeyHandle1)
  1186.     CloseRegKey $(CS_KeyHandle2)
  1187.     return $(RegistryErrorIndex)
  1188.  
  1189.  
  1190. ; ---------------------------------------------------------------------------
  1191. ; GetListIndex
  1192. ;
  1193. ; Purpose:
  1194. ;   Returns the index (beginning with 1) of the specified string.  A return
  1195. ;   of 0 signalls an error.
  1196. ; ---------------------------------------------------------------------------
  1197.  
  1198. [GetListIndex]
  1199.     set CheckList   = $($0)
  1200.     set FindString  = $($1)
  1201.     set ReturnIndex = 0
  1202.        
  1203.     read-syms GeneralConstants
  1204.     read-syms FileConstants$(!STF_LANGUAGE)
  1205.     read-syms FileConstants
  1206.     read-syms DialogConstants$(!STF_LANGUAGE)
  1207.  
  1208.     ForListDo $(CheckList)
  1209.     ifstr(i) $($) == $(FindString)
  1210.         ifint $(ReturnIndex) == 0
  1211.         set ReturnIndex = $(#)
  1212.         endif
  1213.     endif
  1214.     EndForListDo
  1215.  
  1216. GetListIndex_RETURN =+
  1217.     return $(ReturnIndex)
  1218.   
  1219.     
  1220. ; ---------------------------------------------------------------------------
  1221. ; LANGUAGE-SPECIFIC CONSTANTS
  1222. ; ---------------------------------------------------------------------------
  1223.  
  1224. [LanguagesSupported]
  1225.     ENG
  1226.  
  1227. [OptionsTextENG]
  1228.     ISSERV = "i.Share 3.0 Server"
  1229.  
  1230. [FileConstantsENG]
  1231.     ProCaption    = "i.Share 3.0 Server Setup"
  1232.     ProCancel     = "Cancel"
  1233.     ProCancelMsg  = "i.Share 3.0 Server is not correctly installed.  "+
  1234.             "Are you sure you want to cancel copying files?"
  1235.     ProCancelCap  = "i.Share Setup Message"
  1236.     ProText1      = "Copying:"
  1237.     ProText2      = "To:"
  1238.     FunctionTitle = "i.Share Server Setup"
  1239.  
  1240.     ProductWSSERVERDescription = "Artisoft i.Share Server gives you the ability to share a Winsock connection among several network clients"
  1241.  
  1242.     ProductWSSERVERDisplayName = "i.Share 3.0 Server"
  1243.  
  1244.     ProductWSSERVERTitle       = "i.Share 3.0 Server"
  1245.  
  1246.     ShellCodeErrorTitle        = "Error: "$(FunctionTitle)
  1247.     ShellCodeErrorText         = "Shell Code Error."
  1248.  
  1249. [DialogConstantsENG]
  1250.     Help                       = "&Help"
  1251.     Exit                       = "Cancel"
  1252.     OK                         = "OK"
  1253.     HelpContext                = ""
  1254.     Continue                   = "Continue"
  1255.     Cancel                     = "Cancel"
  1256.  
  1257. [FileDependentDlgENG]
  1258.  
  1259. ; ---------------------------------------------------------------------------
  1260. ; Copyright (C) 1997 Artisoft, Inc.
  1261. ; ---------------------------------------------------------------------------
  1262.